package com.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.service.UserService;

@Controller
public class IndexController {
	
	@Autowired
	private UserService userService;
	
	/*****
	 * 测试整合jsp的方法
	 * @return
	 */
	@RequestMapping("/index")
	public String index() {
		return "index";
	}

	@ResponseBody
	@RequestMapping("/restIndex")
	public String restIndex() {
		userService.createUser("jdbc:" + System.currentTimeMillis(), 19);
		return "success";
	}
}
